<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //while 案例
        // 1.打印人的一生，从1岁到100岁
        var age=1;
        do{
            console.log('今年我'+age+'岁了');
            age++;
        }while (age<=100);
        // 2.计算1~100 之间的所有整数的和
        var i=1;
        var sum=0;
        do{
            sum+=i;
            i++;
        }while(i<=100);
        console.log(sum);
        //弹出一个提示框
        do{
            var message=prompt('你爱我吗？');
        }while(message !=='我爱你')
        alert('我也爱你');
    </script>
</head>
<body>
    
</body>
</html>